package com.log.james.mapper;

import com.log.james.entity.FwlogFlow;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;
import java.util.Map;


@Mapper
public interface FwlogFlowDao {
    @Select("select * from fwlogflow order by starttime desc limit 1,5")
    List<FwlogFlow> findByTime();

    @Select("select * from fwlogflow f where f.endtime = #{time}")
    FwlogFlow findFlowByTime(@Param("time") Date time);

//    获取最近三十条数据
    @Select("select * from fwlogflow order by starttime desc limit 1,30")
    List<FwlogFlow> getHalfHourData();

    @Select("select * from fwlogflow f where f.starttime >= #{time}")
    List<FwlogFlow> getTodayAllData(@Param("time")Date time);

    @Select("select * from fwlogflow where starttime >= #{st} and endtime <= #{et}")
    List<FwlogFlow> findFwlogFlowByTime(@Param("st")Date st,@Param("et")Date et);
}
